home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1832 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.umbc.edu!not-for-mail
  2. From: schlein@umbc.edu (Jonas J. Schlein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help with simple code
  5. Date: 16 Jan 1996 21:00:08 -0500
  6. Organization: University of Maryland Baltimore County
  7. Message-ID: <4dhl78$fd1@umbc9.umbc.edu>
  8. References: <4dbak5$oij@ionews.io.org> <4deocm$4co@su3.in.net>
  9. NNTP-Posting-Host: f-umbc9.umbc.edu
  10. NNTP-Posting-User: schlein
  11.  
  12. |> Can anyone tell me what's wrong with this piece of code? I lifted it
  13. |> straight from a textbook.
  14. |> 
  15. |> Here's the code:
  16.  
  17. <code unnecessary for analysis of problem>
  18.  
  19. |> and here's the error:
  20. |>  
  21. |> In function `main':
  22. |> undefined reference to `pow'
  23. |> 
  24. |> I don't understand. `pow' is a function, not a variable?
  25. |> Can anyone tell me what's wrong?
  26.  
  27. I suspect you may be using UNIX, but in any case you did include <math.h>,
  28. not shown, so the problem is most likely a link problem and not with
  29. the compiler or your code. This is addressed in FAQ questions 13.25,
  30. 13.26 and 14.3. This is freely available in electronic format at
  31. ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/comp/lang/c/C-FAQ-list.
  32. -- 
  33. "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
  34.  
  35. Jonas J. Schlein  (schlein@gl.umbc.edu)
  36.